-- GENERATED SPELL FOR [High Priest Yath'amon] --


function spell0_30831(pUnit, Event) --@Encasing Webs,n/a--
pUnit:FullCastSpellOnTarget(4962,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_30831', 8000, 1)
end

function spell1_30831(pUnit, Event) --@Mind Flay,n/a--
pUnit:FullCastSpellOnTarget(38243,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_30831', 3000, 1)
end

function spell2_30831(pUnit, Event) --@Psychic Scream,Self--
pUnit:FullCastSpellOnTarget(34322,pUnit)
pUnit:RegisterEvent('Sorts_30831', 4350, 1)
end

function spell3_30831(pUnit, Event) --@Venomous Bite,n/a--
pUnit:FullCastSpellOnTarget(61705,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_30831', 8000, 1)
end

function Sorts_30831(pUnit, Event)
local choix_sorts_30831 = math.random(0, 3)
if choix_sorts_30831 == 0 then
pUnit:RegisterEvent('spell0_30831', 1, 1)
end
if choix_sorts_30831 == 1 then
pUnit:RegisterEvent('spell1_30831', 1, 1)
end
if choix_sorts_30831 == 2 then
pUnit:RegisterEvent('spell2_30831', 1, 1)
end
if choix_sorts_30831 == 3 then
pUnit:RegisterEvent('spell3_30831', 1, 1)
end
end

function mob30831_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_30831', math.random(1500, 3000), 1)
end

function mob30831_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob30831_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob30831_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(30831, 1, 'mob30831_Action')
RegisterUnitEvent(30831, 2, 'mob30831_Leave')
RegisterUnitEvent(30831, 3, 'mob30831_Kill')
RegisterUnitEvent(30831, 4, 'mob30831_Die')
